<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>UE编辑器显示---开题报告</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/lib/layui/layui/css/layui.css"/>
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery/jquery.cookie.js"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript"
            charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="/js/common/fileupload.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/layui.all.js"></script>
    <script src="/lib/ueditor/ueditor.config.js?20200919" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/ueditor/ueditor.all.js?20200919" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/ueditor/UEcontroller.js?20200919" type="text/javascript" charset="utf-8"></script>
    <style>
        .item img {
            height: 40px;
        }

        .layui-form-label {
            width: 77px;
        }

        .openFile input[type=file] {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 18px;
            z-index: 99;
            opacity: 0;
        }
        .edui-editor-iframeholder{
            height: 400px !important;
        }

    </style>
</head>
<body>
<div class="layui-form">
    <div class="layui-form-item" style="margin-bottom: 0px;">
        <label class="layui-form-label" style="margin-left: 9px">开题报告</label>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-left: 43px;  margin-right: 43px;">
            <div id="container" style="width: 99.9%;min-height: 300px;" name="content" type="text/plain"></div>
        </div>
    </div>
    <div class="layui-form-item" style="margin-top:15px">
        <label class="layui-form-label" style="width: 100px;margin-left:-20px">附件：</label>
        <div class="layui-input-block" style="padding-top: 9px">
            <div id="fileAll"></div>
            <a href="javascript:;" class="openFile" style="float: left;position:relative">
                <img src="../img/mg11.png" alt="">
                <span><fmt:message code="email.th.addfile"/></span>
                <input type="file" multiple id="fileupload" data-url="/upload?module=fixAssets" name="file">
            </a>
        </div>
    </div>
    <%--<div class="layui-form-item" style="margin-bottom: 0px;">
        <label class="layui-form-label" style="margin-left: 9px">中期报告</label>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-left: 43px;  margin-right: 43px;">
            <div id="container2" style="width: 99.9%;min-height: 300px;" name="content" type="text/plain"></div>
        </div>
    </div>
    <div class="layui-form-item" style="margin-top:15px">
        <label class="layui-form-label" style="width: 100px;margin-left:-20px">附件：</label>
        <div class="layui-input-block" style="padding-top: 9px">
            <div id="fileAll2"></div>
            <a href="javascript:;" class="openFile" style="float: left;position:relative">
                <img src="../img/mg11.png" alt="">
                <span><fmt:message code="email.th.addfile"/></span>
                <input type="file" multiple id="fileupload2" data-url="/upload?module=fixAssets" name="file">
            </a>
        </div>
    </div>--%>
    </form>
</div>
</div>
</body>
</html>
<script>
    var ue = null
    // var ue2 = null
    layui.use(['form'], function () {
        var form = layui.form
        form.render();
        fileuploadFn('#fileupload', $('#fileAll'));
        // fileuploadFn('#fileupload2', $('#fileAll2'));
        $(function () {
            UE.delEditor('container');
            // UE.delEditor('container2');
            //富文本
            ue = UE.getEditor('container', {elementPathEnabled: false});
            // ue2 = UE.getEditor('container2', {elementPathEnabled: false});
        })
        //删除附件
        $(document).on('click', '.deImgs', function () {
            var _this = this;
            var attUrl = $(this).parents('.dech').attr('deUrl');
            layer.confirm('确定删除该附件吗？', function (index) {
                $.ajax({
                    type: 'get',
                    url: '/delete?' + attUrl,
                    dataType: 'json',
                    success: function (res) {

                        if (res.flag == true) {
                            layer.msg('删除成功', {icon: 6, time: 1000});
                            $(_this).parent().remove();
                        } else {
                            layer.msg('删除失败', {icon: 2, time: 1000});
                        }
                    }
                })
            });
        });

    });
</script>
